package com.cloudservice.ccs.model;

import com.cloudservice.ccs.util.Constant;
import lombok.AllArgsConstructor;
import lombok.Data;

@Data
@AllArgsConstructor
public class ApiResult {

    private String error;

    private Object data;

    public static ApiResult success() {
        return new ApiResult(null, null);
    }

    public static ApiResult successWithData(Object data) {
        return new ApiResult(null, data);
    }

    public static ApiResult failure() {
        return new ApiResult(Constant.DEFAULT_ERROR_MESSAGE, null);
    }

    public static ApiResult failureWithData(Object data) {
        return new ApiResult(Constant.DEFAULT_ERROR_MESSAGE, data);
    }
}
